package com.zzyl.service.impl;

import com.zzyl.mapper.MyTaskMapper;
import com.zzyl.service.MyTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Service
public class MyTaskServiceImpl implements MyTaskService {

    @Autowired
    private MyTaskMapper myTaskMapper;

    @Override
    public void executeTask() {

        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
        LocalDateTime localDateTime = LocalDateTime.now();

        String time = localDateTime.format(dtf);

        myTaskMapper.executeTask(time);
    }
}
